package exp8;


public class Exp8_2 {

	public static void main(String[] args) {

		try {
			int[] a = null;
			System.out.println(a[1]);
		} catch (NullPointerException e) {
			System.err.println("空指针异常！");
		}
		try {
			Object x = new Integer(0);
			x = (String) x;
		} catch (ClassCastException e) {
			System.err.println("代码试图将对象强制转换为不是实例的子类!");
		}
		try {
			String a = "jjj";
			System.out.println(Integer.parseInt(a));
		} catch (NumberFormatException e) {
			System.err.println("代码试图将没有适当格式字符串转换为数字类型！");
		}
		try {
			int[] a = new int[-1];
		} catch (NegativeArraySizeException e) {
			System.err.println("代码试图创建负大小的数组！");
		}
//		try {
//
//		} catch (NoSuchMethodException e) {
//			System.err.println("没有找到特定方法！");
//		}

	}
}
